<div class="zs-body" data-ng-init="
		formInit('roles', {
			keyField:'id',
			randomFields:['id']
		}) && 
		formInit('userinfo', {
			ssn:'vuserinfo',
			esn:'userinfo',
			keyField:'userid',
			randomFields:['userid'],
			orderObject:{userid:0} 
		}) && loadData('userinfo');setConHei();">
	<div class="zs-map-tool">
		<div class="location">
			<a >首页</a>
			<i class="right-arr"></i>
			<a >运维管理</a>
			<i class="right-arr"></i>
			<a >用户管理</a>
		</div>
		<div class="option">
			<input type="button" class="zs-btn orange" value="新建" 
				ng-click="addRow('userinfo') && openWindow('edit');"/>
			<input type="button" class="zs-btn orange" value="编辑" 
				ng-click="editRow('userinfo', userinfo.sRows[0]) && openWindow('edit')"/>
			<input type="button" class="zs-btn orange" value="删除 " 
				ng-click="delEntitys('userinfo')"/>
			<input type="button" class="zs-btn orange" value="登录授权 " 
				ng-click="userAuthentication() && openWindow('edit2')"/>
			<input type="button" class="zs-btn orange" value="角色授权 " 
				ng-click="editRow('userinfo', userinfo.sRows[0]) && openWindow('edit3')"/>
		</div>
	</div>
	<div class="zs-tree">
        <div class="zs-nice-tab idTabs">
            <div class="tool item" style="margin-left:6px;">
                <span class="search-warpper" style="width:230px">
                    <i class="icon"></i>
                    <input type="text" class="zs-input" placeholder="机构名称" 
                    	ng-model="dicTree.filterValue" 
                    	ng-change="comboFilter('dicTree')"/>
                </span>
            </div>
        </div>
        <div style="margin-left: 15px;margin-top: 15px;margin-right: 15px;">
            <ag-Tree fn='dicTree'
				para="{ uDictionary:true,
					dictionary:'p_organization',
					checkbox:false,
					pidField:'pid',
					leafField:'leaf',
					intLoadLevel:2}"
				onselect="userOrgSearch"
				ng-model='o'/>
        </div>
    </div>
    <div class="zs-content withTree" style="position:unset">
    	<div class="zs-nice-tab idTabs">
    		<div class="tool item" style="margin-left:6px">
	    		<span class="search-warpper">
	    			<i class="icon"></i>
		    		<input type="text" placeholder="姓名" class="zs-input" ng-model="userinfo.queryObject['userName:like']"/>
	    		</span>
    		</div>
    		<div class="operation item">
    			<a class="ope-1" ng-click="loadData('userinfo')"></a>
    			<a class="ope-2"></a>
    			<div class="zs-sort-board">
    				<div class="up sort-item">
	    				<a class="btn" href="javascript:;">升序</a>
    				</div>
    				<div class="down sort-item">
	    				<a class="btn" href="javascript:;">降序</a>
    				</div>
    			</div>
    		</div>
    	</div>

        <div class="zs-data-table">
        	<div class="container">
	            <table>
	                <thead>
	                    <tr>
	                        <th>
	                        	<input id="allCheckbox" type="checkbox"
	                        		ng-click="selectAll('userinfo','allCheckbox');">
	                        </th>
	                        <th>姓名/帐号</th>
	                        <th>所属机构</th>
	                        <th>所属角色</th>
	                        <th>登录是否启用</th>
	                    </tr>
	                </thead>
	                <tbody>
	                    <tr ng-repeat="r in userinfo.datas">
			                <td><input type="checkbox"
				                    ng-click="selectRow('userinfo',r);"
				                    ng-model="r.selected" />
			                </td>
			                <td>
			                    <a ng-click="editRow('userinfo',r) && openWindow('edit');">
			                        <label ng-bind="r.userName"></label>
			                        <label ng-if="r.accounts">/</label>
			                        <label ng-bind="r.accounts"></label>
			                    </a>
			                </td>
			                <td>
			                    <a ng-click="editRow('userinfo',r) && openWindow('edit');">
			                        <label ng-bind="r.organizationName"></label>
			                    </a>
			                </td>
			                <td>
			                    <a ng-click="editRow('userinfo',r) && openWindow('edit');">
			                        <label ng-bind="r.roleNames"></label>
			                    </a>
			                </td>
			                <td>
			                    <a ng-click="editRow('userinfo',r) && openWindow('edit');">
			                        <label ng-bind="r.valid | asChineseBool"></label>
			                    </a>
			                </td>
			            </tr>
	                </tbody>
	            </table>
        	</div>
        </div>
        <div class="zs-pagination-box">
            <ag-Page fn='userinfo'></ag-Page>
        </div>

        <div ag-Window id="edit" title="用户编辑" width='620px' height='150px'>
	        <div class="zs-form-tab ibox">
	        	<form name="form" novalidate>
				    <table>
				        <tbody>
				        	<tr>
	                            <td class="text" width="20%">姓名</td>
	                            <td class="left" width="30%"><input type="text" alias="姓名"
	                                name="formUserName" ng-model="userinfo.editRow.userName"
	                                class="zs-input" required></td>
								<td class="text" width="20%">所属机构</td>
								<td class="left" width="30%">
									<ag-Combotree class="zs-input" style="width:172px;height: 28px"
												  fn='orgidEdit'
												  para="{ uDictionary:true,
												dictionary:'p_organization',
												pidField:'pid',
	                    						leafField:'leaf'}"
												  ng-model="userinfo.editRow.organizationId"
												  text-Value="userinfo.editRow.organizationName"/>
								</td>
	                        </tr>
	                        <tr>
	                            <td class="text" width="20%">电话</td>
	                            <td class="left" width="30%"><input type="text"
	                                ng-model="userinfo.editRow.tel" class="zs-input"></td>
	                            <td class="text" width="20%">邮件</td>
	                            <td class="left" width="30%"><input type="text"
	                                ng-model="userinfo.editRow.email" class="zs-input"></td>
	                        </tr>
				        </tbody>
				        <tfoot>
				            <tr>
				                <td colspan="5">
				                    <input type="button" name="ok" value="保存" class="zs-btn c-red"
				                    	ng-click="formValidate(form) && save('userinfo', userinfo.editRow, saveCloseWindow)"/>
				                    <input type="button" name="ok" value="取消" class="zs-btn c-green" 
				                    	ng-click="closeWindow('edit')" />
				                </td>
				            </tr>
				        </tfoot>
				    </table>
				</form>
			</div>
	    </div>

	    <div ag-Window id="edit2" title="登录授权" width='420px' height='180px'>
	        <div class="zs-form-tab ibox">
	        	<form name="form2" novalidate>
				    <table>
				        <tbody>
				        	<tr>
	                            <td class="text" width="20%">帐号</td>
	                            <td colspan="3" class="left" width="80%">
	                            	<input type="text" alias="帐号"
	                                	ng-model="userauthentication.editRow.accounts"
	                                	class="zs-input" required>
	                            </td>
	                        </tr>
	                        <tr>
	                            <td class="text" width="20%">密码</td>
	                            <td colspan="3" class="left" width="80%">
	                            	<input type="text" alias="密码"
		                                ng-model="userauthentication.editRow.password"
		                                class="zs-input" required>
		                       	</td>
	                        </tr>
	                        <tr>
	                            <td class="text" width="20%">是否启用</td>
	                            <td colspan="3" class="left" width="80%">
	                            	<input type="checkbox" ng-model="userauthentication.editRow.valid"
		                        		ng-true-value="true" ng-false-value="false" value='false' />
								</td>
	                        </tr>
				        </tbody>
				        <tfoot>
				            <tr>
				                <td colspan="5">
				                    <input type="button" name="ok" value="授权" class="zs-btn c-red"
				                    	ng-click="formValidate(form2) && saveUserAuthentication('userauthentication', userauthentication.editRow, saveCloseWindow)"/>
				                    <input type="button" name="ok" value="取消" class="zs-btn c-green" 
				                    	ng-click="closeWindow('edit2')" />
				                </td>
				            </tr>
				        </tfoot>
				    </table>
				</form>
			</div>
	    </div>

	    <div ag-Window id="edit3" title="角色授权" width='440px' height='610px'>
	        <div class="zs-form-tab ibox" data-ng-init="iniTab('datatab', 'tab1', 'selected');">
	        	<form name="form3" novalidate>
	        		<div class="zs-itab">
						<div class="zs-itab-title">
							<ul class="idTabs">
								<li><a ng-click="setTab('datatab', 'tab1');" 
									class="{{tabs['datatab'].tabClass['tab1']}}">所属角色</a></li>
							</ul>
						</div>
					</div>

					<div ng-show="tabs['datatab'].tabShow['tab1']" style="height: 490px;margin:5px 10px">
					    <!-- <ag-Tree fn='role'
					    	para="{	pidField:'pid',
        							leafField:'leaf',
        							onlyLeafCheck:true,
        							bindField:'roleId',
        							bindFn:'roles',
									defaultQueryObject:{valid:true},
									queryObject:{pid:''},
									orderObject:{order:0}}"
							ng-model="userinfo.editRow.roles" /> -->

						<ag-Tree 
							para="{ uDictionary:true,
									dictionary:'p_role',
									pidField:'pid',
        							leafField:'leaf',
        							onlyLeafCheck:true,
        							bindField:'roleId',
        							bindFn:'roles',
        							intLoadLevel:2}"
							ng-model="userinfo.editRow.roles" />
				    </div>

					<div>
				    	<table width="100%">
				    		<tfoot>
				    			<tr>
				    				<td>
				    					<input type="button" name="ok" value="保存" class="zs-btn c-red"
					                    	ng-click="formValidate(form3) && save('userinfo', userinfo.editRow, saveCloseWindow)"/>
					                    <input type="button" name="ok" value="取消" class="zs-btn c-green" 
					                    	ng-click="closeWindow('edit3')" />
				    				</td>
				    			</tr>
				    		</tfoot>
				    	</table>
				    </div>
				</form>
			</div>
	    </div>
    </div>
</div>